import { createStore, applyMiddleware, compose, combineReducers } from 'redux'  // 引入createStore方法
import thunk from 'redux-thunk'
import indexReducer from '../reducer/reducer'
// import roleReducer from '../reducer/roleReducer'

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
    window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose

const enhancer = composeEnhancers(applyMiddleware(thunk))

const appReducer = combineReducers({
    indexReducer
})

const store = createStore(appReducer, enhancer)          // 创建数据存储仓库
export default store 